package com.taobaolite.cart_has_items;

import com.taobaolite.item.ItemBody;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import java.sql.Timestamp;

@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
public class CartBody {
    @NotNull
    private ItemBody item;
    @NotNull
    @Min(value = 90000000)
    private Long userId;
    @NotNull
    @Min(value = 0)
    private Integer amountInCart;
    private Timestamp createdTime;

}

@AllArgsConstructor
@Getter
@Setter
@NoArgsConstructor
class PutCart {
    @NotNull
    @Min(value = 900000000)
    private Long userId;
    @NotNull
    @Min(value = 10000000)
    private Long itemId;
    @NotNull
    @Min(value = 0)
    private Integer amount;
}
